#include <stdio.h>
#include <string.h>

void main(){
    int n;
    while(scanf("%d",&n)!=EOF){
        int mark=0;
        //printf("%d",n);
        char c;
        scanf("%c",&c);
        for (int i=0;i<n;i++){
            char cooker[100];
            int j=0;
            do{
                scanf("%c",&c);
                if (c=='\n'||c==' ')break;
                cooker[j]=c;
                j++;
            }while (1);
            cooker[j]='\0';
            //printf("%s",cooker);
            //printf("%d",i);
            if (strcmp(cooker,"bowl")==0||strcmp(cooker,"knife")==0||strcmp(cooker,"fork")==0||strcmp(cooker,"chopsticks")==0){
                if (mark==1)printf(" ");
                printf("%s",cooker);
                mark=1;
            }
            
        }
        
        printf("\n");
    }
}


